#pragma once
#include "CApplication.h"
#include "CWorkbooks.h"
#include "CWorkbook.h"
#include "CWorksheets.h"
#include "CWorksheet.h"
#include "CRange.h"

class ExcelHelper
{
public:
	ExcelHelper(void);
	~ExcelHelper(void);
	void init(void);
	void release(void);
	void load(CString fileName,int &rowMax,int &colMax);
	void get(int rowIndex,int colIndex,CString& content);
	void set(int rowIndex,int colIndex,const CString value);
	void save(CString** saveData,int rowCount,int colCount);


	CApplication excelApp;
	CWorkbooks workBooks;
	CWorkbook workBook;
	CWorksheets workSheets;
	CWorksheet workSheet;

	CString data[1024][20];

	CString fileName;


	int oldMaxRow;
	static ExcelHelper * GetInstance()    
    {    
        static ExcelHelper instance;     
        return &instance;    
    }   
	void openExcel(void);
	void closeExcel(void);
};

